<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include("include/header.php"); ?>
<title><?php echo $info->name; ?> | <?php echo $info->description; ?></title>
<link rel="alternate" type="application/rss+xml" title="<?php echo $info->name; ?> &raquo; Feed" href="<?php echo $this->url($info->type, $info->ID); ?>/feed" />
<link href="<?php echo $this->setting->static; ?>/css/blog.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $this->setting->static; ?>/js/dpsh.js"></script>	
</head>

<body>
<?php include("include/banner.php"); ?>
<div id="container">
	<div id="blog">
		<div id="content">
			<div id="main">
				<div id="main-content">
					<?php if($info->type=='home') {?>
					<ul class="paged">
						<?php $pager->render(); ?>
						<li class="r"><a href="<?php echo $this->url('home'); ?>/">Home</a></li>
					</ul>
					<?php } else { ?>
					<h1 class="title no-border"><?php echo $info->name; ?><span><sup><?php echo $info->type; ?></sup></span></h1>
					<?php } ?>
					<div class="clear"></div>
					<?php foreach($posts->Data AS $key => $post) { ?>
					<?php $author = $this->cache->get_author_detail($post->author); ?>
					<ul class="post" id="post-<?php echo $post->ID; ?>">
						<li class="title"><a href="<?php echo $this->url('post', $post->ID); ?>" title="<?php echo $post->title; ?>"><?php echo $post->title; ?></a></li>
						<?php if($post->thumbnail!='') {?>
						<li class="gallery"><img src="<?php echo $post->thumbnail; ?>" /></li>
						<?php } ?>
						<li class="meta">发表于 <a href="<?php echo $this->url('date', $post->date); ?>"><?php echo date('Y/m/d',$post->time); ?></a> <?php echo date('H:i',$post->time); ?> 作者 <a href="<?php echo $this->url('author', $author->nicename); ?>" title="查看 <?php echo $author->display_name; ?> 的所有帖子"><?php echo $author->display_name; ?></a></li>
						<li class="content">
							<div class="text" id="content-<?php echo $post->ID; ?>">
							<?php
								if($post->password=='' || $this->check_post_password($post->ID)) {
									echo $this->htmlSubString($post->content, 480);
								} else {
									include("include/password.php");
								}
							?>
							</div>
							<div class="clear"></div>
						</li>
						<li class="meta meta1">
							<span class="cat">分类: </span>
							<?php $c = array();
							foreach((array)$this->cache->get_term_by_id($post->ID, 'category') as $category) {
								$c[] = "<a href=\"".$this->url('category', $category->ID)."\" title=\"查看 ".$category->name." 中的全部文章\">"
										. $category->name . "</a>"; 
							}
							echo implode('; ', $c); unset($c);
							?>
							<span class="sep">|</span>
							<span class="tag">标签:</span> 
							<?php $k = array();
							foreach((array)$this->cache->get_term_by_id($post->ID, 'post_tag') as $tag) {
								$k[] = "<a href=\"".$this->url('post_tag', $tag->ID)."\">" . $tag->name . "</a>";
							}
							echo implode('; ', $k); unset($k); 
							?>
							<?php if($post->comment_status=='open'){ ?>
							<span class="sep">|</span>
							<span class="tag">评论:</span> 
							<a href="<?php echo $this->url('post', $post->ID); ?>#respond" title="《<?php echo $post->title; ?>》上的评论">(<?php echo $post->comment; ?>)</a>
							<?php } ?>
							<?php if($post->author==$this->logged_user->ID) {?>
							<span class="sep">|</span> 
							<a href="<?php echo str_replace('%post_id%', $post->ID, $this->config->WP_URL['edit_post']); ?>">编辑</a>
							<?php }?>
						</li>
					</ul>
					<?php } ?>
					<div class="clear"></div>
					<ul class="paged paged1">
						<?php $pager->render(); ?>
						<li class="r"><a href="<?php echo $this->url('home'); ?>/">Home</a><span>»</span><a href="#top">Top</a><span>↑</span></li>
					</ul>
				</div>
			</div>
			
			<!-- side bar -->
			<div id="side">
				<?php include("include/sidebar.php"); ?>
			</div>
			
			<div class="clear h25"></div>
		</div>
		<div class="clear"></div>
	</div>	
</div>

<?php include("include/footer.php"); ?>
</body>
</html>